<?php
namespace app\api\controller;

use tp5_lib\api\controller\ApiBaseController;
use app\user\service\UserService;

class GatewayController extends ApiBaseController
{
    public function index()
    {
        $user = new \ReflectionClass(UserService::class);
        print_r($user);

        $comment=$user->getDocComment();
        echo $comment . "\r\n";

        $updateInfo = new \ReflectionMethod(UserService::class,"updateInfo");
        print_r($updateInfo);

        $number=$updateInfo->getNumberOfRequiredParameters();
        $params=$updateInfo->getParameters();
        $list=[];
        foreach($params as $index => $param){
            $item=[
                "name"=>$param->getName(),
                "type"=>(string)$param->getType(),
            ];
            if($index >= $number){
                $item["default"]=$param->getDefaultValue();
            }
            $list[]=$item;
        }
        print_r($list);
        
        exit;
    }
}
